import { createSSRApp } from "vue";
import App from "./App.vue";
import { createPinia } from 'pinia';
import { createUnistorage } from "pinia-plugin-unistorage";

export function createApp() {
  //createSSRApp 创建Vue应用实例
  const app = createSSRApp(App);
  // createPinia 创建Pinia实例
  const pinia = createPinia()
// 使用 unistorage 插件，让 pinia 支持持久化存储
   pinia.use(createUnistorage())

  // 把Pinia整合到Vue应用实例中
  app.use(pinia)

  return {
    app,
  };
}
